Imports StartPoint.BR.Interfaces
Imports StartFrame.BR.Interfaces

Namespace Compras.Listados

    Public Class Iva
        Inherits StartFrame.US.Listador

        Dim _Transacciones As ITransaccionesCpras

#Region " Windows Form Designer generated code "

        Public Sub New()
            MyBase.New()

            'This call is required by the Windows Form Designer.
            InitializeComponent()

            'Add any initialization after the InitializeComponent() call

        End Sub

        'Form overrides dispose to clean up the component list.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        'Required by the Windows Form Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Windows Form Designer
        'It can be modified using the Windows Form Designer.  
        'Do not modify it using the code editor.
        Friend WithEvents fe_transaccion As LnkDesdeHastaFecha
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Iva))
            Me.fe_transaccion = New LnkDesdeHastaFecha
            Me.Contenedor.SuspendLayout()
            Me.TabPage1.SuspendLayout()
            CType(Me.lnk_dataSet, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'cboReporte
            '
            Me.cboReporte.Name = "cboReporte"
            Me.cboReporte.Size = New System.Drawing.Size(309, 21)
            Me.cboReporte.ValueMember = "ID"
            '
            'Contenedor
            '
            Me.Contenedor.Controls.Add(Me.fe_transaccion)
            Me.Contenedor.Name = "Contenedor"
            '
            'StatusBar1
            '

            '
            'lblReporte
            '
            Me.lblReporte.Name = "lblReporte"
            '
            'lblTitulo
            '
            Me.lblTitulo.Name = "lblTitulo"
            Me.lblTitulo.Text = "Libro I.V.A. Compras"
            '
            'TabPage1
            '
            Me.TabPage1.Name = "TabPage1"
            '
            'cmdMinimizar
            '
            Me.cmdMinimizar.Image = CType(resources.GetObject("cmdMinimizar.Image"), System.Drawing.Image)
            Me.cmdMinimizar.Name = "cmdMinimizar"
            '
            'fe_transaccion
            '
            Me.fe_transaccion.BackColor = System.Drawing.SystemColors.ControlLight
            Me.fe_transaccion.Desde = New Date(2000, 1, 1, 14, 46, 0, 0)
            Me.fe_transaccion.Hasta = New Date(2003, 8, 26, 15, 48, 29, 227)
            Me.fe_transaccion.Location = New System.Drawing.Point(128, 0)
            Me.fe_transaccion.Name = "fe_transaccion"
            Me.fe_transaccion.Size = New System.Drawing.Size(176, 20)
            Me.fe_transaccion.TabIndex = 2
            '
            'Iva
            '
            Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
            Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
            Me.ClientSize = New System.Drawing.Size(564, 384)
            Me.Name = "Iva"
            Me.Text = "KLiva"
            Me.Contenedor.ResumeLayout(False)
            Me.TabPage1.ResumeLayout(False)
            CType(Me.lnk_dataSet, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub

#End Region

        Private Sub Iva_OnLoadForm(ByRef reportCollection As StartFrame.US.Listador.Reports) Handles MyBase.OnLoadForm

            Try
                'Asigna valor predeterminado de fecha
                Dim fecha As ISql = CType(RemotingHelper.getObject(GetType(ISql)), ISql)
                fe_transaccion.Desde = fecha.GetDate(ISql.Formato.Fecha).AddMonths(-1)
                fe_transaccion.Hasta = fecha.GetDate(ISql.Formato.Fecha)

                'Agrega los reportes
                Dim rpt As Report
                Dim rangoFeTransaccion As New Rango(3, "fe_transaccion", fe_transaccion)

                rpt = New Report(1, "kliva_mensual", "Mensual", "kliva_mensual", "US.spmc.compras.reportes")
                rpt.Rangos.Add(rangoFeTransaccion)
                reportCollection.Add(rpt)

                rpt = New Report(2, "kliva_anual", "Anual", "kliva_anual", "US.spmc.compras.reportes")
                rpt.Rangos.Add(rangoFeTransaccion)
                reportCollection.Add(rpt)

                'Referencia el objeto de negocios relacionado
                _Transacciones = CType(RemotingHelper.getObject(GetType(ITransaccionesCpras)), ITransaccionesCpras)
                Me.ObjetoReglasNegocio = _Transacciones

            Catch ex As Exception
                StartFrame.US.Display.ShowError(ex.Message)

            End Try

        End Sub

    End Class

End Namespace